package com.chen.palmar.project.home;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.chen.palmar.R;
import com.chen.palmar.base.BaseActivity;
import com.chen.palmar.common.widget.view.AutoToolbar;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * Created by chen on 2018/1/3.
 */

public class ApplyTypeActivity extends BaseActivity {

    @Bind(R.id.title_bar)
    TextView titleBar;
    @Bind(R.id.tool_bar)
    AutoToolbar toolBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    @Override
    public void init() {
        titleBar.setText("发布");
        toolBar.setNavigationOnClickListener(v -> ApplyTypeActivity.this.finish());
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_apply_type;
    }

    @OnClick({R.id.ly_agency, R.id.ly_supply, R.id.ly_purchase})
    public void onViewClicked(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.ly_agency://经销商
                intent.setClass(this,ApplyAgencyActivity.class);
                startActivity(intent);
                break;
            case R.id.ly_supply://供应
                intent.putExtra("type","2");
                intent.setClass(this,ApplyInfoActivity.class);
                startActivity(intent);
                break;
            case R.id.ly_purchase://采购
                intent.putExtra("type","1");
                intent.setClass(this,ApplyInfoActivity.class);
                startActivity(intent);
                break;
        }
    }
}
